/*
 * @Description:
 * @Author: mmzhang
 * @Date: 2021-12-15 17:16:05
 * @LastEditTime: 2023-01-12 14:30:15
 */
import Opt from '@/components/dt/info/Opt.js'
import subMgr from '@/biz/sales/subOrder.js'
import dateOpt from '@/biz/option/date.js'
import ruleOpt from '@/biz/option/rule.js'
import houseOpt from '@/biz/option/house.js'
import tool from '@/common/tool.js'
import nameOpt from '@/biz/option/name.js'
import caseMgr from '@/biz/crimeSceneList'

let _this = null
class copyOpt extends Opt {
  constructor(vm) {
    _this = vm
    super()
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    let copyList = [
      {
        key: '1',
        value: '开盘批次'
      },
      {
        key: '2',
        value: '渠道'
      },
      {
        key: '3',
        value: '台账'
      },
      {
        key: '4',
        value: '线上售楼处'
      },
      // {
      //   key: '5',
      //   value: '霸屏神器'
      // },
      {
        key: '6',
        value: '置业计划书'
      },
      {
        key: '7',
        value: '楼盘建模'
      },
      {
        key: '8',
        value: '楼盘户型'
      }
    ]

    this.all = [
      houseOpt.create({
        key: 'sourceBuildingId',
        title: '项目名称',
        rules: [
          {
            required: true,
            type: 'number',
            message: '请输入项目名称',
            trigger: 'blur'
          }
        ],
        to: (info) => {
          return {
            sourceBuildingId: info.housesId,
            companyId: info.companyId,
            housesName: info.housesName
          }
        }
      }),
      {
        title: '复制模块',
        key: 'copyTypes',
        checkbox: {
          options: copyList
        },
        rules: [ruleOpt.required('请选择复制模块', 'array')]
      }
    ]
  }
}

export default copyOpt
